package com.vodone.v1pin.userInfo.delegate
{
	import com.vodone.v1pin.ServiceProvider;
	import com.vodone.v1pin.core.model.MainModelLocator;
	import com.vodone.v1pin.core.service.HttpJsonDelegate;
	
	import mx.rpc.http.mxml.HTTPService;

	public class OrderDelegate
	{
		public static function getOrderList( resultHandler:Function , type:String , orderState:String = "" , payState:String = "" , faultHandler:Function = null , context:Array = null ):void
		{
			var service:HTTPService = ServiceProvider.getInstance().getOrderService;
			var params:Object = {
				userID : MainModelLocator.getInstance().userLoginVO.userId,
				type : type,
				orderState : orderState,
				payState : payState
			}
			var delegate:HttpJsonDelegate = new HttpJsonDelegate( service );
			delegate.send( params , resultHandler , faultHandler , context );
		}
		public static function updateOrder(resultHandler:Function , type:String ,orderNum:String , orderState:String = "" , faultHandler:Function = null , context:Array = null ):void
		{
			var service:HTTPService = ServiceProvider.getInstance().updateOrderService;//667788
			var params:Object = {
				userID : MainModelLocator.getInstance().userLoginVO.userId,
				type : type,
				orderNum : orderNum,
				orderState : orderState
			}
			var delegate:HttpJsonDelegate = new HttpJsonDelegate( service );
			delegate.send( params , resultHandler , faultHandler , context );
		}
		public static function returnOrder(resultHandler:Function , orderNum:String , name:String , mobile:String , phone:String , Reason:String , faultHandler:Function = null , context:Array = null ):void
		{
			var service:HTTPService = ServiceProvider.getInstance().returnOrderService;//退单
			var params:Object = {
				userID : MainModelLocator.getInstance().userLoginVO.userId,
				orderNum : orderNum,
				name : name,
				mobile : mobile,
				phone : phone ,
				Reason : Reason
			}
			var delegate:HttpJsonDelegate = new HttpJsonDelegate( service );
			delegate.send( params , resultHandler , faultHandler , context );
		}
	}
}